<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
       <form id="myForm">
			<label>用户名:</label><input id="username" type = "text" name="username" placeholder="请设置用户名" required/>
			<span  id="msg"></span>
            <input type="submit" value="submit">
		</form>
       <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
       <script type="text/javascript">
		   
		   $().ready(function(){
		   $("#username").blur(function(){
			   var username = $("#username").val();
			   user_span = $("#msg");
			   console.log("http://127.0.0.1:5000/check_form?username="+username);
			   //发送get请求，第一个参数是url路径，第二个是回调函数
               //get post 参数传递方式不同
//			   $.get("http://127.0.0.1:5000/check_form?username="+username, function(data){
//				   user_span.text(data)
//			   })
//               $.post("http://127.0.0.1:5000/check_form",{"username":username},function(data){
//                   user_span.text(data);
//               })
               $.getJSON("http://127.0.0.1:5000/show_detail",function(data){
                   user_span.text(JSON.stringify(data))
              })
		   })
		   })
       </script>


</body>
</html>